<script setup>
	let arrs = ref([])

	async function request() {
		let res = await uni.request({
			url: "https://jsonplaceholder.typicode.com/posts",

			//1
			// success: res => {
			// 	console.log(res);
			// 	arrs.value = res.data;
			// }

		})
		//2
		// .then(res => {
		// 	console.log(res);
		// 	arrs.value = res.data;
		// })

		console.log(res);
		arrs.value = res.data;

	}

	request();
</script>
<template>
	<view class="layout">
		<view class="row" v-for="item in arrs" :key="arrs.id">
			<view class="title">{{item.title}}</view>
			<row></row>
			<view class="content">{{item.body}}</view>
		</view>
	</view>
</template>
<style lang="scss" scoped>
	.layout {
		padding: 30rpx;

		.row {
			border: 1px solid #ccc;
			padding: 20rpx 0;

			.title {
				font-size: 40rpx;
				margin-bottom: 10rpx;
			}

			.content {
				font-size: 28rpx;
				color: #666;
			}
		}
	}
</style>